<?php

function getRegistry($suser)
{
//TODO: this function must loop thru the 
//folders and place the stuff in the array.
	$registry = array();

	$basedir = "/home/glidecas/public_html/chirplace1.0.0.0.com/usr/".$suser."/images";

	$handler = opendir($basedir);

	while ($file = readdir($handler))
	{
		if ($file != '.' && $file != '..')
		{
			if (substr($file, -3) == "php")
			{
				$fileparts = explode(".", $file);
				$imagefile = $fileparts[0].".jpg";
				$regitem = array();
				array_push($regitem, $basedir."/".$imagefile);
				array_push($regitem, $basedir."/".$file);
				array_push($registry, $regitem);
			}
		}
	}
	closedir($handler);
	
	$rootdir = "/home/glidecas/public_html/chirplace1.0.0.0.com";
	$basedir = $rootdir."/paths";
	$handler = opendir($basedir);

	while ($file = readdir($handler))
	{
		if ($file != '.' && $file != '..')
		{
			if (substr($file, -3) == "php")
			{
				$fileparts = explode(".", $file);
				$imagefile = $fileparts[0].".jpg";
				$regitem = array();
				array_push($regitem, $rootdir."/twbacks/".$imagefile);
				array_push($regitem, $basedir."/".$file);
				array_push($registry, $regitem);
			}
		}
	}
	closedir($handler);

	return $registry;
}

?>